﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class reply : System.Web.UI.Page
{
    protected BLL.Message bllmessage = new BLL.Message();
    protected int uid;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (common.isLoginOrNot())
        {
            uid = ((MODEL.Users)Session["currentUser"]).UId;
            if (bllmessage.getAllMessage(uid) != null)
            {
                //绑定留言
                List<MODEL.Message> models = bllmessage.getAllMessage(uid);
                foreach (MODEL.Message m in models)
                {
                    //跳到该页面的时候留言标志为看过
                    bllmessage.isLookByMid(m.MId);
                }
                rpMessage.DataSource = models;
                rpMessage.DataBind();
            }
            if (bllmessage.getReply(uid) != null)
            {
                //绑定回复
                List<MODEL.Message> models2=bllmessage.getReply(uid);
                foreach (MODEL.Message m in models2)
                {
                    //跳到该页面的时候回复标志为看过
                    bllmessage.isLookByMid(m.MId);
                }
                rpReply.DataSource = models2;
                rpReply.DataBind();
            }
        }
    }
}